<html>
<head>
	<meta charset="utf-8"/>
	<title>Operaciones</title>
    <script language="javaScript" src="file:///|/jquery-1.7.1.min.js">
</script>
</head>

<body>
	<label>Factorial de este número: <input type="number" id= "inputFactorial" size="2">
	</label>
	<button id="btnFactorial">Calcula</button>
	<br><br>

	<label>Calcula el logaritmo en 10 de: <input type="number" id="log-input" size="2">
	</label>
	<button id="logaritmo-button">Calcula</button>
	<br><br>

	<label>Calcula el seno de: <input type="number" id="angulo1-input" size="2">
	</label>
	<button id="seno-button">Calcula</button>
	<br><br>

	<label>Calcula el coseno de: <input type="number" id="angulo2-input" size="2">
	</label>
	<button id="coseno-button">Calcula</button>
	<br><br>

	<div id="solution">
	</div>

	<script type="text/javascript">

	$('#btnFactorial').on('click', function(evt){
		var fac = $('#inputFactorial')[0].value;
		var v=1;
		for (var i=1; i<=fac; i++){
			v=v*i;
		}
		$('body').append('<p> El Factorial es ' + v + '<p>');
	});
	/*
	function factorial()
	{
		var fac=document.getElementById('factorial-input').value;
		var v=1;
		for (var i=1; i<fac; i++){
			v=v*i;
		}
		document.getElementById('solution').innerHTML=('Factorial de ' + fac + ' = ' + v);
	}
	document.getElementById('factorial-button').addEventListener('click',factorial);
	//document.getElementById('factorial-button').addEventListener('mouseover',factorial);
*/
	$('#logaritmo-button').on('click', function(evt){
		var loga = $('#log-input')[0].value;
		var res=Math.LOG10E*loga;
		
		$('body').append('<p> El lagoritmo de ' + loga + ' es ' + res + '<p>');
	});
	/*
	function log ()
	{
		var loga=document.getElementById('log-input').value;
		res=Math.LOG10E*loga;
		document.getElementById('solution').innerHTML=('Logaritmo de ' + loga + '= ' + res);
	}
	document.getElementById('logaritmo-button').addEventListener('click',log);
	//document.getElementById('logaritmo-button').addEventListener('mouseover',log);
	*/
	$('#seno-button').on('click', function(evt){
		var n = $('#angulo1-input')[0].value;
		var sen=Math.sin(n);
		
		$('body').append('<p> El seno de ' + n + ' es ' + sen + '<p>');
	});
/*
	function seno()
	{
		var n=document.getElementById('angulo1-input').value;
		sen=Math.sin(n);
		document.getElementById('solution').innerHTML=('Seno de ' + n + '= ' + sen);
	}
	document.getElementById('seno-button').addEventListener('click', seno);
	//document.getElementById('seno-button').addEventListener('mouseover', seno);
*/
	$('#coseno-button').on('click', function(evt){
		var n = $('#angulo2-input')[0].value;
		var cos=Math.cos(n);
		
		$('body').append('<p> El seno de ' + n + ' es ' + cos + '<p>');
	});
/*
	function coseno ()
	{
		var n=document.getElementById('angulo2-input').value;
		cos=Math.cos(n);
		document.getElementById('solution').innerHTML=('Coseno de ' + n + '= ' + cos);
	}
	document.getElementById('coseno-button').addEventListener('click', coseno);
	//document.getElementById('coseno-button').addEventListener('mouseover', coseno);
*/
	</script>
</body>

</html>